package com.blue;

import com.blue.service.OrderService;
import com.blue.service.OrderServiceImpl;
import com.blue.service.TimerInvocationHandler;

import java.lang.reflect.Proxy;

public class Main {
    public static void main(String[] args) {
        OrderService orderService = new OrderServiceImpl();

        OrderService proxy = (OrderService) Proxy.newProxyInstance(orderService.getClass().getClassLoader(), orderService.getClass().getInterfaces(), new TimerInvocationHandler(orderService));

        proxy.insertOrder();
        proxy.deleteOrder();
        proxy.modifyOrder();
        String str = proxy.selectOrderById(10001);

    }
}
